package com.atguigu.gmall.payment.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.payment.PaymentInfo;
import com.atguigu.gmall.payment.client.impl.PaymentDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author atguigu-mqx
 * @Description TODO
 * @Date 2023/9/8 11:18
 * @Version 1.0
 */
@FeignClient(value = "service-payment",fallback = PaymentDegradeFeignClient.class)
public interface PaymentFeignClient {

    /**
     * 查看是否有本地交易记录
     * @param outTradeNo
     * @return
     */
    @GetMapping("/api/payment/alipay/getPaymentInfo/{outTradeNo}")
    PaymentInfo getPaymentInfo(@PathVariable String outTradeNo);

    /**
     * 关闭支付宝交易记录
     * @param orderId
     * @return
     */
    @GetMapping("/api/payment/alipay/closeAlipay/{orderId}")
    Result closeAlipay(@PathVariable Long orderId);

    /**
     * 查看是否有交易记录
     * @param orderId
     * @return
     */
    @GetMapping("/api/payment/alipay/checkPayment/{orderId}")
    Result checkPayment(@PathVariable Long orderId);
}
